import { getMatryoshkaRequest } from "@common/utils";
import { CTX_PATH } from "@common/constants";
import Instance from "@common/remoteCallInterceptor";
import { WarehouseQueryUrls } from "../urls";

export default {
  loadItemDetails: ({ warehouseId, barcode }) => {
    let req = getMatryoshkaRequest({ warehouseId, barcode }, [warehouseId, barcode]);
    return Instance.matryoshkaInstance.post(WarehouseQueryUrls.loadItemDetails, req, {
      baseURL: CTX_PATH.getMatryoshkaPrefix()
    });
  },
  loadLocDetails: ({ warehouseId, barcode }) => {
    let req = getMatryoshkaRequest({ warehouseId, barcode }, [warehouseId, barcode]);
    return Instance.matryoshkaInstance.post(WarehouseQueryUrls.loadLocDetails, req, {
      baseURL: CTX_PATH.getMatryoshkaPrefix()
    });
  }
};
